home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 34 / Mac Magazin and MacEasy Magazine CD - Issue 34.iso / Grafik & Text / Alpha ƒ / Tcl / Menus / toolboxAssistMenu.tcl < prev   
Text File  |  1996-08-15  |  2KB  |  85 lines

  1. #================================================================================
  2. # QuickView™ Toolbox Assistant Help
  3. #================================================================================
  4.  
  5. if $startingUp {
  6.     set toolboxRefMenu    "•400"
  7.     addMenu toolboxRefMenu
  8.     return
  9. }
  10.  
  11.  
  12. proc toolboxRefMenu {} {}
  13.  
  14. menu -m -n $toolboxRefMenu -p toolboxProc {
  15.     "Goto Reference"
  16.     "(-"
  17.     "Display Trap Template"
  18.     "Insert Trap Template"
  19.     "/L<O<ULookup Trap"
  20. }
  21.  
  22.  
  23. proc toolboxProc {menu item} {
  24.     switch $item {
  25.         "Goto Reference"        { gotoTBReference }
  26.         "Display Trap Template"    { displayTBTrapTemplate }
  27.         "Insert Trap Template"     { insertTBTrapTemplate }
  28.         "Lookup Trap"            { lookupTBTrap }
  29.     }
  30. }
  31.  
  32.  
  33. set lastTrap {}
  34.  
  35. proc insertTBTrapTemplate {} {
  36.     global lastTrap
  37.  
  38.     if {![string length [checkRunning QuickView™ ALTV tassPath]]} return
  39.     set text [getSelect]
  40.     if {![string length $text]} {
  41.         if {[catch {prompt "Trap name:" $lastTrap} text]} return
  42.     } else {
  43.         deleteText [getPos] [selEnd]
  44.     }
  45.     set lastTrap $text
  46.     set res [AEBuild -r {'ALTV'} DanR {TMPL} "----" "“$text”"]
  47.     regexp {“.*”} $res one
  48.     insertText [string trim $one {“”}]
  49. }
  50.  
  51. proc displayTBTrapTemplate {} {
  52.     global lastTrap
  53.  
  54.     if {![string length [checkRunning QuickView™ ALTV tassPath]]} return
  55.     set text {}
  56.     catch {set text [getSelect]}
  57.     if {![string length $text]} {
  58.         if {[catch {prompt "Trap name:" $lastTrap} text]} return
  59.     }
  60.     set lastTrap $text
  61.  
  62.     set res [AEBuild -r {'ALTV'} DanR {TMPL} "----" "“$text”"]
  63.     regexp {“.*”} $res one
  64.     alertnote [string trim $one {“”}]
  65. }
  66.  
  67. proc lookupTBTrap {} {
  68.     global lastTrap
  69.  
  70.     if {![string length [checkRunning QuickView™ ALTV tassPath]]} return
  71.     set text {}
  72.     catch {set text [getSelect]}
  73.     if {![string length $text]} {
  74.         if {[catch {prompt "Trap name:" $lastTrap} text]} return
  75.     }
  76.     set lastTrap $text
  77.     AEBuild {'ALTV'} DanR {REF } "----" "“$text”"
  78. }
  79.  
  80. proc gotoTBReference {} {
  81.     catch {switchTo [checkRunning QuickView™ ALTV tassPath]}
  82. }
  83.  
  84.  
  85.